package a02demo2;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Test1 {
    public static void main(String[] args) {
        String s = "1111111000";
        char[] arr = s.toCharArray();

        Random r = new Random();
        int index = r.nextInt(arr.length);

        ArrayList<String> list1 = new ArrayList<>();
        Collections.addAll(list1, "a", "b", "c", "d");

        ArrayList<String> list2 = new ArrayList<>();
        Collections.addAll(list2, "e", "f", "g", "h");

        if (index == 1) {
            Collections.shuffle(list1);
            String s1 = list1.get(0);
            System.out.println(s1);
        } else {
            Collections.shuffle(list2);
            String s2 = list2.get(0);
            System.out.println(s2);
        }
    }
}
